import { Gateway, getGateway } from "@/droplet-bus/core.define";

import { NotchQuery, NotchQueryCache, RiverStockGateway } from "@/river-stock/core.define";

// 订单库存
export const OrderStockGateway: Gateway = getGateway(RiverStockGateway, "river_stock_order");
export type getOrderStockStatMonthDto = {
  tradeYear: number;
  tradeMonth: number;
  tradeScope: string;
  query: NotchQuery[];
};

export interface OrderStockInterfaceWithDerive<T> {
  /** 统计指定月份的库存 */
  getOrderStockStatMonth(dto: T & getOrderStockStatMonthDto): Promise<NotchQueryCache>;
}

// 常规（数量）库存
export const CommonStockGateway: Gateway = getGateway(RiverStockGateway, "river_stock_common");
